package tests;

import javax.swing.plaf.synth.SynthEditorPaneUI;
import java.util.Scanner;

public class test23 {
    /*//红与黑
    static int[][] fang = {{-1,0},{1,0},{0,-1},{0,1}};
    static int count = 0;
    public static void dfs(char[][] arr,int m,int n,int a,int b){

        if('#' == arr[a][b]) {
            return;
        }
        ++count;
        arr[a][b] = '#';
        for(int i = 0;i < 4;i++){
            int aa = a + fang[i][0];
            int bb = b + fang[i][1];

            if(aa >=0 && aa < m && bb >=0 && bb < n){
                dfs(arr,m,n,aa,bb);
            }
        }

    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){

            int m = sc.nextInt();
            int n = sc.nextInt();

            char[][] arr = new char[m][n];
            int a = 0,b = 0;
            for(int i = 0;i < m;i++){
                String s = sc.next();
                for(int j = 0;j < n;j++){
                    arr[i][j] = s.charAt(j);
                    if('@' == arr[i][j]){
                        a = i;
                        b = j;
                    }
                }
            }


            count = 0;
            dfs(arr,m,n,a,b);
            System.out.println(count);
        }
    }*/
    //蘑菇阵
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int k = sc.nextInt();
        boolean[][] las = new boolean[n][m];
        for(int i = 0;i < k;i++){
            int a = sc.nextInt();
            int b = sc.nextInt();
            las[a][b] = true;
        }
        int[][] arr = new int[n][m];
        for(int i = 1;i < m;i++){
            arr[0][i] = 1;
        }
        for(int j = 1;j < n;j++){
            arr[j][0] = 1;
        }
        for(int i = 1;i < n;i++){
            for(int j = 1;j < m;j++){
                if(!las[i][j]){
                    arr[i][j] = arr[i-1][j]+arr[i][j-1];
                }else{

                }

            }
        }
    }
}
